/**
 * 用户类 controller
 */
const ApiErrorNames = require('../config/ApiErrorNames.js');
const APIError = require('../middlewares/result.js').APIError;
const articleService = require('../service/article.js');

/**
 * 查询所有用户
 */

let publish = async (ctx) => {
  const { userId='1' } = ctx.session.user || {};
  let {title, content} = ctx.request.body;
  let result = await articleService.publish({userId, title, content});
  ctx.body = result;
};



module.exports = {
  publish
};
